using Box2D.XNA;
using Microsoft.Xna.Framework;
using ElementumForever.Interfaces;

namespace ElementumForever.Factory
{
    class PhysicalFactory
    {
        public const float PixelToMeter = 32;

        public static Body CreatBody(PhysicalWorld world, BodyDef bodyDef)
        {
            Body body = world.CreateBody(bodyDef);
            return body;
        }

        public static Body CreatBody(PhysicalWorld world, BodyDef bodyDef, IShape shape, float density)
        {
            Box2D.XNA.Shape bShape = shape.ConventToBox2DShape();
            Body body = CreatBody(world, bodyDef);
            body.CreateFixture(bShape, density);
            return body;
        }

        public static Body CreatBody(PhysicalWorld world, BodyType bodyType, IShape shape, float density)
        {
            BodyDef bodyDef = new BodyDef();
            bodyDef.type = bodyType;
            return CreatBody(world, bodyDef, shape, density);
        }



    }
}
